version 14.2
set more off

***********************************************************************************************************************
* THIS ROUTINE GENERATES FIGURE A.V OF WASEEM (2020) ROLE OF WITHHOLDING ...
***********************************************************************************************************************

* MANUFACTURERS VS. IMPORTERS 

use					"$project_data\STPAK_1996_2011_UBP_v1.dta", clear
keep              if business_sts=="1" | business_sts=="2"
bys					regno:egen entry=min(taxperiod)	
duplicates			drop regno, force
keep					entry taxperiod fy item_cd business_sts
g						ind=real(substr(item_cd,1,4))
drop					if ind<1600
drop					if ind>=2500 & ind<2800
g						treat=(business_sts=="1")
g						one=1
bys					entry treat:egen nentrants=sum(one)
keep					if entry>=d(01apr2000) & entry<d(01jan2001)
g						rweek=wofd(entry)
g						date=dofw(rweek)
local					sa=d(27may2000)
local					ba=d(17jun2000)
local					ss=d(22aug2000)
local					apr=d(01apr2000)
local					may=d(01may2000)
local					jun=d(01jun2000)
local					jul=d(01jul2000)
local					aug=d(01aug2000)
local					sep=d(01sep2000)
local					oct=d(01oct2000)
local					nov=d(01nov2000)
local					dec=d(01dec2000)
#d;
twoway  				(connected  nentrants date if treat==1,sort lwidth(thick) lcolor(red) mcolor(red) msymbol(o))
						(connected  nentrants date if treat==0,sort lwidth(thick) lcolor(midblue) mcolor(midblue) msymbol(o) lpattern(shortdash)),
						xlabel(`apr' "Apr" `may' "May" `jun' "Jun" `jul' "Jul" `aug' "Aug" `sep' "Sep" `oct' "Oct" `nov' "Nov" `dec' "Dec")
						ytitle(Number of Firms, alignment(bottom)) yscale(r(0))  yscale(titlegap(*10)) 
						xtitle("Month of the Year 2000") xscale(titlegap(*10))
						xline(`sa' `ba' `ss' `jul', lpatter(dash) lcolor(green)) 
						legend(region(style(none)) label(1 "Manufacturers") label(2 "Importers") rows(1)) 
						graphregion(fcolor(white) style(none) color(white) margin(0 2 0 2)) bgcolor(white); 	
graph 					export "$project_output\Entry_Weekly_MVsI.eps", replace;
#d						cr

* MANUFACTURERS VS. SERVICE PROVIDERS 

use					"$project_data\STPAK_1996_2011_UBP_v1.dta", clear
keep              if business_sts=="1" | business_sts=="8"
bys					regno:egen entry=min(taxperiod)	
duplicates			drop regno, force
keep					entry taxperiod fy item_cd business_sts
g						ind=real(substr(item_cd,1,4))
drop					if ind<1600
drop					if ind>=2500 & ind<2800
g						treat=(business_sts=="1")
g						one=1
bys					entry treat:egen nentrants=sum(one)
keep					if entry>=d(01apr2000) & entry<d(01jan2001)
g						rweek=wofd(entry)
g						date=dofw(rweek)
local					sa=d(27may2000)
local					ba=d(17jun2000)
local					ss=d(22aug2000)
local					apr=d(01apr2000)
local					may=d(01may2000)
local					jun=d(01jun2000)
local					jul=d(01jul2000)
local					aug=d(01aug2000)
local					sep=d(01sep2000)
local					oct=d(01oct2000)
local					nov=d(01nov2000)
local					dec=d(01dec2000)
#d;
twoway  				(connected  nentrants date if treat==1,sort lwidth(thick) lcolor(red) mcolor(red) msymbol(o))
						(connected  nentrants date if treat==0,sort lwidth(thick) lcolor(midblue) mcolor(midblue) msymbol(o) lpattern(shortdash)),
						xlabel(`apr' "Apr" `may' "May" `jun' "Jun" `jul' "Jul" `aug' "Aug" `sep' "Sep" `oct' "Oct" `nov' "Nov" `dec' "Dec")
						ytitle(Number of Firms, alignment(bottom)) yscale(r(0))  yscale(titlegap(*10)) 
						xtitle("Month of the Year 2000") xscale(titlegap(*10))
						xline(`sa' `ba' `ss' `jul', lpatter(dash) lcolor(green)) 
						legend(region(style(none)) label(1 "Manufacturers") label(2 "Service Providers") rows(1)) 
						graphregion(fcolor(white) style(none) color(white) margin(0 2 0 2)) bgcolor(white); 	
graph 				export "$project_output\Entry_Weekly_MVsS.eps", replace;
#d						cr
